<div class="site-content">
  <div class="d-flex flex-md-row flex-items-center stafftools-page-header">
    <div class="col-1">
      <span class="assignment-icon assignment-icon-individual left">
        <%= octicon 'person', height: 22 %>
      </span>
    </div>

    <div class="col-10 col-md-10 d-flex flex-column">
      <h2 class="stafftools-heading">
        <%= t('views.stafftools.repo_accesses.repository_access') %>: <%= @repo_access.id %>
      </h2>

      <p class="assignment-type text-gray"><%= t('views.stafftools.repo_accesses.repository_access')%></p>
    </div>
  </div>

  <div class="boxed-group">
    <h3><%= t('views.stafftools.repo_accesses.accesses')%></h3>

    <div class="boxed-group-inner">
      <% owner        = @repo_access.user %>
      <% organization = @repo_access.organization %>

      <table>
        <tr>
          <td class="text-emphasized"><%= t('views.stafftools.repo_accesses.id') %></td>
          <td><%= @repo_access.id %></td>
        </tr>
        <% if @repo_access.github_team_id.present? %>
          <tr>
            <td class="text-emphasized"><%= t('views.stafftools.repo_accesses.github_team_id') %></td>
            <td><%= @repo_access.github_team_id %></td>
          </tr>
        <% end %>
        <tr>
          <td class="text-emphasized"><%= t('views.stafftools.repo_accesses.owned_by') %></td>
          <td><%= link_to owner.github_user.login, stafftools_user_path(owner) %></td>
        </tr>
        <tr>
          <td class="text-emphasized"><%= t('views.stafftools.repo_accesses.organization') %></td>
          <td><%= link_to organization.title, stafftools_organization_path(organization.id) %></td>
        </tr>
        <tr>
          <td class="text-emphasized"><%= t('views.stafftools.repo_accesses.created_on') %></td>
          <td><%= local_time(@repo_access.created_at) %></td>
        </tr>
      </table>
    </div>
  </div>
</div>
